package com.learn.project2.model.vo.admin.user;

import com.learn.project2.bean.MarketUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
/**
 * @description: admin/user/list的响应数据封装：UserListVO,UserVo
 * @author wxy
 * @date 2022-01-07 16:23
 * @version 1.0
 */
@NoArgsConstructor
@Data
public class UserListVO {

    private Integer total;//总数据量
    private Integer pages;//总页码数
    private Integer limit;//当前页最多的数据量
    private Integer page;//当前页的页码
    private List<MarketUser> list;//当前页的数据


    public static UserListVO data(long total,Integer pages,Integer limit,Integer page,List list) {
        UserListVO userListVO = new UserListVO();
        userListVO.setTotal((int) total);
        userListVO.setPages(pages);
        userListVO.setPage(page);
        userListVO.setLimit(limit);
        userListVO.setList(list);
        return userListVO;
    }
}
